#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Square.h>
#include <iostream>

FIXTURE(Square)
{
    TEST(should get 0 if side = 0 when calculating area)
    {
         Square square(0);
         ASSERT_EQ(0, square.calcArea());
    }

    TEST(should get 0 if side < 0 when calculating perimeter)
    {
         Square square(-10.588);
         ASSERT_EQ(0, square.calcPerimeter());
    }

    TEST(should get 0 if side > 75  when calculating area)
    {
         Square square(75.235);
         ASSERT_EQ(0, square.calcArea());
    }


    TEST(should be able to calculate area(reserve 2 digit for para, round for result): 10.147 * 10.147 = 102.82)
    {
         Square square(10.147);
         ASSERT_EQ(102.82, square.calcArea());
    }

    TEST(should be able to calculate perimeter(reserve 2 digit for para, round for result): 4 * 10.147 = 40.56)
    {
         Square square(10.147);
         ASSERT_EQ(40.56, square.calcPerimeter());
    }

    TEST(should be able to set side to 51.345 before culating area: 51.345 * 51.345 = 2635.80)
    {
         Square square(10.147);
         square.setSide(51.345);
         ASSERT_EQ(2635.80, square.calcArea());
    }

    TEST(should get original area  when set invalid side to 78 before culating area)
    {
         Square square(10.147);
         square.setSide(78);
         ASSERT_EQ(102.82, square.calcArea());
    }
};
